$(document).ready(function() {
	
	redrawDotNav();
	
	/* Scroll event handler */
    $(window).bind('scroll',function(e){
    	parallaxScroll();
		redrawDotNav();
    });
    
	/* Next/prev and primary nav btn click handlers */
	$('a.home').click(function(){
    	$('html, body').animate({
    		scrollTop:0
    	}, 1000, function() {
	    	parallaxScroll(); // Callback is required for iOS
		});
    	return false;
	});

	$('a.cooperate').click(function(){
    	$('html, body').animate({
    		scrollTop:$('#cooperate').offset().top
    	}, 1000, function() {
	    	parallaxScroll(); // Callback is required for iOS
		});
    	return false;
    });
    
    
});

/* Scroll the background layers */
function parallaxScroll(){
	var scrolled = $(window).scrollTop();
}

/* Set navigation dots to an active state as the user scrolls */
function redrawDotNav(){
	var section1Top =  0;
	// The top of each section is offset by half the distance to the previous section.

	// var section4Top =  $('#cooperate').offset().top - (($(document).height() - $('#cooperate').offset().top) /15);
	

	// $('ul.menu a').removeClass('active');
	// if($(document).scrollTop() < section4Top){
	// 	$('ul.menu a.home').addClass('active');
	// }  else if ($(document).scrollTop() >= section4Top){
	// 	$('ul.menu a.cooperate').addClass('active');
		
	// }

}
